package tt.dz.appserver.service.business.imp;

import java.util.List;

import javax.annotation.Resource;

import org.apache.avro.AvroRemoteException;

import tt.dz.appserver.dao.ext.CityDao;
import tt.dz.appserver.dao.ext.DistrictDao;
import tt.dz.appserver.dao.ext.ProvinceDao;
import tt.dz.appserver.entity.model.dic.City;
import tt.dz.appserver.entity.model.dic.District;
import tt.dz.appserver.entity.model.dic.Province;
import tt.dz.appserver.service.business.DicService;

public class DicServiceImpl implements DicService {

	@Resource
	ProvinceDao provinceDao;
	@Resource
	CityDao cityDao = new CityDao();
	@Resource
	DistrictDao districtDao = new DistrictDao();
	
	@Override
	public List<Province> provinceselect() throws AvroRemoteException {
		// TODO Auto-generated method stub
			
		List<Province> provinceList = provinceDao.findProvince(null);
		return provinceList;
	}

	@Override
	public List<City> cityselectbyprovince(String provinceid) throws AvroRemoteException {
		// TODO Auto-generated method stub
				
		List<City> cityList = cityDao.findCityByProvince(provinceid);
		return cityList;
	}

	@Override
	public List<District> districtselectbycity(String cityid) throws AvroRemoteException {
		// TODO Auto-generated method stub
		
		List<District> districtList = districtDao.findDistrictbyCity(cityid);
		return districtList;
	}

}
